﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="../Converter.xaml" />
    </ResourceDictionary.MergedDictionaries>
    <Style x:Key="NewRadioButtonStyle" TargetType="{x:Type RadioButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <StackPanel Orientation="Horizontal">
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                            Content="{TemplateBinding Content}" TextElement.Foreground="#031f4b"
                                            ContentTemplate="{TemplateBinding ContentTemplate}"
							                RecognizesAccessKey="True" Margin="{TemplateBinding Padding}"
							                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
							                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        <Image x:Name="RadioButtonImage" HorizontalAlignment="Left" VerticalAlignment="Center" 
									Stretch="Fill" Source="/Skins/Resource/Image/RadioButton-Unchecked.png" 
                               Width="35" Height="35" />
                    </StackPanel>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter TargetName="RadioButtonImage" Property="Source" Value="/Skins/Resource/Image/RadioButton-Checked.png" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="RadioButtonImage" Property="Opacity" Value="0.5" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="TestItemRadioButton" TargetType="{x:Type RadioButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <StackPanel x:Name="TestItemContainerStackPanel" Orientation="Horizontal" Margin="0,0,0,20">
                        <StackPanel.ToolTip>
                            <Label Width="140" Height="30" Content="{Binding Tag.TestItemTitle, RelativeSource={RelativeSource TemplatedParent}}" 
                                   HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="20" />
                        </StackPanel.ToolTip>
                        <Image x:Name="ArrowRightImage" Visibility="Hidden" Source="/Skins/Resource/Image/ArrowHead-Right.png" Width="64" />
                        <Border x:Name="TestItemContainerBorder" BorderThickness="1" BorderBrush="Black" 
                                Background="#6ac239" Width="400" Height="90" CornerRadius="4" Padding="5">
                            <StackPanel Orientation="Horizontal" Margin="3,0,0,0">
                                <Image x:Name="TestItemImage" Height="78" 
                                       Source="{Binding Tag.TestItemName, RelativeSource={RelativeSource TemplatedParent}, 
                                        Converter={StaticResource TestItemDarkImageSourceConverter}}" />
                                <Border Margin="5,0,10,0" Width="300" Height="72" CornerRadius="4" 
                                        Background="#868788" BorderThickness="1" BorderBrush="Black">
                                    <TextBlock x:Name="TestResultTextBlock" FontSize="42" 
                                           Padding="15,10,0,0" Foreground="White" 
                                           Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" 
                                           Tag="{Binding Tag.IsSelected, RelativeSource={RelativeSource TemplatedParent}}" />
                                </Border>
                            </StackPanel>
                        </Border>
                    </StackPanel>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter TargetName="TestItemContainerBorder" Property="Background" Value="#919292" />
                            <Setter TargetName="ArrowRightImage" Property="Visibility" Value="Visible" />
                            <Setter TargetName="TestItemImage" Property="Source" 
                                    Value="{Binding Tag.TestItemName, RelativeSource={RelativeSource TemplatedParent}, 
                                    Converter={StaticResource TestItemBrightImageSourceConverter}}" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="TestItemContainerBorder" Property="Background" Value="#919292" />
                            <Setter TargetName="TestItemImage" Property="Source" 
                                    Value="{Binding Tag.TestItemName, RelativeSource={RelativeSource TemplatedParent}, 
                                    Converter={StaticResource TestItemBrightImageSourceConverter}}" />
                        </Trigger>
                        <DataTrigger Binding="{Binding Text, ElementName=TestResultTextBlock}" Value="">
                            <Setter TargetName="TestItemContainerBorder" Property="Background" Value="#c5c5c5" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Tag, ElementName=TestResultTextBlock}" Value="False">
                            <Setter TargetName="TestItemContainerStackPanel" Property="Visibility" Value="Collapsed" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="VerticalFlatRadioButton" TargetType="{x:Type RadioButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <TextBlock x:Name="MainContent" Padding="2" Foreground="White" FontSize="16" Background="#365585" 
                               Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" TextWrapping="Wrap" />
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="False">
                            <Setter TargetName="MainContent" Property="Background" Value="LightGray" />
                            <Setter TargetName="MainContent" Property="Foreground" Value="Black" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="MainContent" Property="Background" Value="#0f2e5e" />
                            <Setter TargetName="MainContent" Property="Foreground" Value="White" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="MainContent" Property="Background" Value="White" />
                            <Setter TargetName="MainContent" Property="Foreground" Value="Black" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>